From ec004872501501ccb32e0f73afdbfac803e5e48b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 11 Jan 2008 10:28:42 +0000 Subject: [PATCH] (mac_emacs_pid) [MAC_OSX]: New variable. [MAC_OSX] (init_mac_osx_environment): Initialize it. [MAC_OSX] (mac_try_close_socket) [SELECT_USE_CFSOCKET]: Return 0 when used on child processes. --- src/mac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mac.c b/src/mac.c index e8cb6a15402..dace8864320 100644 --- a/src/mac.c +++ b/src/mac.c @@ -5013,6 +5013,9 @@ extern int noninteractive; sys_select. */ static CFMutableDictionaryRef cfsockets_for_select; +/* Process ID of Emacs. */ +static pid_t mac_emacs_pid; + static void socket_callback (s, type, address, data, info) CFSocketRef s; @@ -5092,7 +5095,7 @@ mac_try_close_socket (fd) int fd; { #if SELECT_USE_CFSOCKET - if (cfsockets_for_select) + if (getpid () == mac_emacs_pid && cfsockets_for_select) { void *key = (void *) fd; CFSocketRef socket = @@ -5329,6 +5332,8 @@ init_mac_osx_environment () char *p, *q; struct stat st; + mac_emacs_pid = getpid (); + /* Initialize locale related variables. */ mac_system_script_code = (ScriptCode) GetScriptManagerVariable (smSysScript); -- 2.30.2